Optimal. Leaf size=133 \[ -192 a^8 x+\frac {192 i a^8 \log (\cos (c+d x))}{d}+\frac {129 a^8 \tan (c+d x)}{d}+\frac {36 i a^8 \tan ^2(c+d x)}{d}-\frac {10 a^8 \tan ^3(c+d x)}{d}-\frac {2 i a^8 \tan ^4(c+d x)}{d}+\frac {a^8 \tan ^5(c+d x)}{5 d}-\frac {64 i a^9}{d (a-i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 45}
\begin {gather*} -\frac {64 i a^9}{d (a-i a \tan (c+d x))}+\frac {a^8 \tan ^5(c+d x)}{5 d}-\frac {2 i a^8 \tan ^4(c+d x)}{d}-\frac {10 a^8 \tan ^3(c+d x)}{d}+\frac {36 i a^8 \tan ^2(c+d x)}{d}+\frac {129 a^8 \tan (c+d x)}{d}+\frac {192 i a^8 \log (\cos (c+d x))}{d}-192 a^8 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3568
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x))^8 \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {(a+x)^6}{(a-x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (129 a^4+\frac {64 a^6}{(a-x)^2}-\frac {192 a^5}{a-x}+72 a^3 x+30 a^2 x^2+8 a x^3+x^4\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-192 a^8 x+\frac {192 i a^8 \log (\cos (c+d x))}{d}+\frac {129 a^8 \tan (c+d x)}{d}+\frac {36 i a^8 \tan ^2(c+d x)}{d}-\frac {10 a^8 \tan ^3(c+d x)}{d}-\frac {2 i a^8 \tan ^4(c+d x)}{d}+\frac {a^8 \tan ^5(c+d x)}{5 d}-\frac {64 i a^9}{d (a-i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(321\) vs. \(2(133)=266\).
time = 6.21, size = 321, normalized size = 2.41 \begin {gather*} \frac {\cos ^3(c+d x) \left (-960 d x \cos (8 c) \cos ^5(c+d x)+480 i \cos (8 c) \cos ^5(c+d x) \log \left (\cos ^2(c+d x)\right )-160 i \cos (2 d x) \cos ^5(c+d x) (\cos (6 c)-i \sin (6 c))+960 i d x \cos ^5(c+d x) \sin (8 c)+480 \cos ^5(c+d x) \log \left (\cos ^2(c+d x)\right ) \sin (8 c)+\sec (c) (\cos (8 c)-i \sin (8 c)) \sin (d x)-52 \cos ^2(c+d x) \sec (c) (\cos (8 c)-i \sin (8 c)) \sin (d x)+696 \cos ^4(c+d x) \sec (c) (\cos (8 c)-i \sin (8 c)) \sin (d x)+160 \cos ^5(c+d x) (\cos (6 c)-i \sin (6 c)) \sin (2 d x)+\cos (c+d x) (\cos (8 c)-i \sin (8 c)) (-10 i+\tan (c))-4 \cos ^3(c+d x) (\cos (8 c)-i \sin (8 c)) (-50 i+13 \tan (c))\right ) (a+i a \tan (c+d x))^8}{5 d (\cos (d x)+i \sin (d x))^8} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 481 vs. \(2 (126 ) = 252\).
time = 0.31, size = 482, normalized size = 3.62
method | result | size |
risch | \(-\frac {32 i a^{8} {\mathrm e}^{2 i \left (d x +c \right )}}{d}+\frac {384 a^{8} c}{d}+\frac {16 i a^{8} \left (150 \,{\mathrm e}^{8 i \left (d x +c \right )}+500 \,{\mathrm e}^{6 i \left (d x +c \right )}+650 \,{\mathrm e}^{4 i \left (d x +c \right )}+385 \,{\mathrm e}^{2 i \left (d x +c \right )}+87\right )}{5 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {192 i a^{8} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(118\) |
derivativedivides | \(\frac {a^{8} \left (\frac {\sin ^{9}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}-\frac {4 \left (\sin ^{9}\left (d x +c \right )\right )}{15 \cos \left (d x +c \right )^{3}}+\frac {8 \left (\sin ^{9}\left (d x +c \right )\right )}{5 \cos \left (d x +c \right )}+\frac {8 \left (\sin ^{7}\left (d x +c \right )+\frac {7 \left (\sin ^{5}\left (d x +c \right )\right )}{6}+\frac {35 \left (\sin ^{3}\left (d x +c \right )\right )}{24}+\frac {35 \sin \left (d x +c \right )}{16}\right ) \cos \left (d x +c \right )}{5}-\frac {7 d x}{2}-\frac {7 c}{2}\right )-4 i a^{8} \left (\cos ^{2}\left (d x +c \right )\right )-28 a^{8} \left (\frac {\sin ^{7}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \left (\sin ^{7}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )}-\frac {4 \left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )-8 i a^{8} \left (\frac {\sin ^{8}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{8}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{6}\left (d x +c \right )\right )}{2}-\frac {3 \left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {3 \left (\sin ^{2}\left (d x +c \right )\right )}{2}-3 \ln \left (\cos \left (d x +c \right )\right )\right )+70 a^{8} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )-56 i a^{8} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-28 a^{8} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+56 i a^{8} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+a^{8} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(482\) |
default | \(\frac {a^{8} \left (\frac {\sin ^{9}\left (d x +c \right )}{5 \cos \left (d x +c \right )^{5}}-\frac {4 \left (\sin ^{9}\left (d x +c \right )\right )}{15 \cos \left (d x +c \right )^{3}}+\frac {8 \left (\sin ^{9}\left (d x +c \right )\right )}{5 \cos \left (d x +c \right )}+\frac {8 \left (\sin ^{7}\left (d x +c \right )+\frac {7 \left (\sin ^{5}\left (d x +c \right )\right )}{6}+\frac {35 \left (\sin ^{3}\left (d x +c \right )\right )}{24}+\frac {35 \sin \left (d x +c \right )}{16}\right ) \cos \left (d x +c \right )}{5}-\frac {7 d x}{2}-\frac {7 c}{2}\right )-4 i a^{8} \left (\cos ^{2}\left (d x +c \right )\right )-28 a^{8} \left (\frac {\sin ^{7}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \left (\sin ^{7}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )}-\frac {4 \left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )-8 i a^{8} \left (\frac {\sin ^{8}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{8}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{6}\left (d x +c \right )\right )}{2}-\frac {3 \left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {3 \left (\sin ^{2}\left (d x +c \right )\right )}{2}-3 \ln \left (\cos \left (d x +c \right )\right )\right )+70 a^{8} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )-56 i a^{8} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-28 a^{8} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+56 i a^{8} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+a^{8} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(482\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 124, normalized size = 0.93 \begin {gather*} \frac {a^{8} \tan \left (d x + c\right )^{5} - 10 i \, a^{8} \tan \left (d x + c\right )^{4} - 50 \, a^{8} \tan \left (d x + c\right )^{3} + 180 i \, a^{8} \tan \left (d x + c\right )^{2} - 960 \, {\left (d x + c\right )} a^{8} - 480 i \, a^{8} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 645 \, a^{8} \tan \left (d x + c\right ) + \frac {320 \, {\left (a^{8} \tan \left (d x + c\right ) - i \, a^{8}\right )}}{\tan \left (d x + c\right )^{2} + 1}}{5 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 245 vs. \(2 (121) = 242\).
time = 0.38, size = 245, normalized size = 1.84 \begin {gather*} -\frac {16 \, {\left (10 i \, a^{8} e^{\left (12 i \, d x + 12 i \, c\right )} + 50 i \, a^{8} e^{\left (10 i \, d x + 10 i \, c\right )} - 50 i \, a^{8} e^{\left (8 i \, d x + 8 i \, c\right )} - 400 i \, a^{8} e^{\left (6 i \, d x + 6 i \, c\right )} - 600 i \, a^{8} e^{\left (4 i \, d x + 4 i \, c\right )} - 375 i \, a^{8} e^{\left (2 i \, d x + 2 i \, c\right )} - 87 i \, a^{8} + 60 \, {\left (-i \, a^{8} e^{\left (10 i \, d x + 10 i \, c\right )} - 5 i \, a^{8} e^{\left (8 i \, d x + 8 i \, c\right )} - 10 i \, a^{8} e^{\left (6 i \, d x + 6 i \, c\right )} - 10 i \, a^{8} e^{\left (4 i \, d x + 4 i \, c\right )} - 5 i \, a^{8} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{8}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{5 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.44, size = 257, normalized size = 1.93 \begin {gather*} \frac {192 i a^{8} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {2400 i a^{8} e^{8 i c} e^{8 i d x} + 8000 i a^{8} e^{6 i c} e^{6 i d x} + 10400 i a^{8} e^{4 i c} e^{4 i d x} + 6160 i a^{8} e^{2 i c} e^{2 i d x} + 1392 i a^{8}}{5 d e^{10 i c} e^{10 i d x} + 25 d e^{8 i c} e^{8 i d x} + 50 d e^{6 i c} e^{6 i d x} + 50 d e^{4 i c} e^{4 i d x} + 25 d e^{2 i c} e^{2 i d x} + 5 d} + \begin {cases} - \frac {32 i a^{8} e^{2 i c} e^{2 i d x}}{d} & \text {for}\: d \neq 0 \\64 a^{8} x e^{2 i c} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 302 vs. \(2 (121) = 242\).
time = 0.95, size = 302, normalized size = 2.27 \begin {gather*} -\frac {16 \, {\left (-60 i \, a^{8} e^{\left (10 i \, d x + 10 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 300 i \, a^{8} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 600 i \, a^{8} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 600 i \, a^{8} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 300 i \, a^{8} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 10 i \, a^{8} e^{\left (12 i \, d x + 12 i \, c\right )} + 50 i \, a^{8} e^{\left (10 i \, d x + 10 i \, c\right )} - 50 i \, a^{8} e^{\left (8 i \, d x + 8 i \, c\right )} - 400 i \, a^{8} e^{\left (6 i \, d x + 6 i \, c\right )} - 600 i \, a^{8} e^{\left (4 i \, d x + 4 i \, c\right )} - 375 i \, a^{8} e^{\left (2 i \, d x + 2 i \, c\right )} - 60 i \, a^{8} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 87 i \, a^{8}\right )}}{5 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.35, size = 102, normalized size = 0.77 \begin {gather*} \frac {\frac {64\,a^8}{\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}}+129\,a^8\,\mathrm {tan}\left (c+d\,x\right )-10\,a^8\,{\mathrm {tan}\left (c+d\,x\right )}^3+\frac {a^8\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5}-a^8\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,192{}\mathrm {i}+a^8\,{\mathrm {tan}\left (c+d\,x\right )}^2\,36{}\mathrm {i}-a^8\,{\mathrm {tan}\left (c+d\,x\right )}^4\,2{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________